//
//  BaseWebController.h
//  Postre
//
//  Created by CoderLT on 2017/5/22.
//  Copyright © 2017年 CoderLT. All rights reserved.
//

#import "BaseRefreshController.h"
#import <WebKit/WebKit.h>

@interface NJKWebViewProgressView : UIView
@property (nonatomic) float progress;

@property (nonatomic) UIView *progressBarView;
@property (nonatomic) NSTimeInterval barAnimationDuration; // default 0.1
@property (nonatomic) NSTimeInterval fadeAnimationDuration; // default 0.27
@property (nonatomic) NSTimeInterval fadeOutDelay; // default 0.1

- (void)setProgress:(float)progress animated:(BOOL)animated;
@end

@interface BaseWebController : BaseRefreshController <WKUIDelegate, WKNavigationDelegate>
@property (nonatomic, assign) BOOL loadSuccess;

@property (nonatomic, strong) WKWebView *webView;
@property (nonatomic, copy) NSString *baseURLString;
@property (nonatomic, copy)   NSString *urlString;
@property (nonatomic, copy)   NSString *webNavTitle;
@property (nonatomic, strong) NJKWebViewProgressView *progressView;

+ (instancetype)vcWithURLString:(NSString *)urlString;
+ (instancetype)vcWithURLString:(NSString *)urlString title:(NSString *)title;

- (void)webViewRequestDidStart;
- (void)webViewRequestDidUpdateProgress:(CGFloat)progress;
- (void)webViewRequestingDidEnd;
@end
